#ifndef TCPGAME_H
#define TCPGAME_H

#include "TGame.h"

class ThreeCardConnection;
class ThreeCardPokerHand;
class ThreeCardSavedGame;


enum AnteBonusPayTableTypes
{
    AB_PAYFREQ_LOW,
    AB_PAYFREQ_MEDIUM,
    AB_PAYFREQ_HIGH,
    MAX_AB_PAYFREQ
};

enum SideBetPayTableTypes
{
    PP_PAYFREQ_LOW,
    PP_PAYFREQ_MEDIUM,
    PP_PAYFREQ_HIGH,
    MAX_PP_PAYFREQ
};


class ThreeCardPokerGame : public TGame
{
	public:
		ThreeCardPokerGame(ThreeCardConnection*, int32 anteBet, int32 pairPlusBet);
		ThreeCardPokerGame(ThreeCardConnection*, ThreeCardSavedGame*);
		~ThreeCardPokerGame();

		bool8 deal(int32 balance);
		bool8 raise();
		bool8 fold();

		int32 getAnteBet();
		int32 getSideBet();

		void send();
		void save(ThreeCardSavedGame*);

		bool8 isGameOK();

        // kharmon.  01-31-06.  #5862.
        ThreeCardPokerHand* getDealer()  { return dealer; }
        ThreeCardPokerHand* getPlayer()  { return player; }

        // kharmon.  10-17-06.  #8226.
        // returns the deck seed that can be used to generate the cards for the current game.
        int32 getDeckSeed() { return m_nDeckSeed; }

	protected:
		bool8 finish(char);
		bool8 calcPayouts(int32*, char, bool8*, int32*, int32*);

		bool8 restore(ThreeCardSavedGame*);

	protected:
		ThreeCardConnection*	conn;
		int32		        		anteBet, pairPlusBet;
		ThreeCardPokerHand*			dealer;
		ThreeCardPokerHand*			player;
        uint8                       anteBonusPayTable, pairPlusPayTable;
		bool8						bGameOK;

        int32                       m_nDeckSeed;            // kharmon.  10-17-06.  #8226. 

		//
		// *IMPORTANT*  When adding/changing here, be sure to update
		//				constructors/destructor, send(), save(), restore()
		//
};

inline int32
ThreeCardPokerGame::getAnteBet()
{
	return anteBet;
}

inline int32
ThreeCardPokerGame::getSideBet()
{
	return pairPlusBet;
}

inline bool8
ThreeCardPokerGame::isGameOK()
{
	return bGameOK;
}

#endif
